package com.leetCode.problem;

/**
 * Description:
 * Copyright:   Copyright (c)2019
 * Company:     zefu
 *
 * @author: 张李鑫
 * @version: 1.0
 * Create at:   2021-12-24 17:43:40
 * <p>
 * Modification History:
 * Date         Author      Version     Description
 * ------------------------------------------------------------------
 * 2021-12-24     张李鑫                     1.0         1.0 Version
 */
public class Problem9 {
    public static boolean isPalindrome(int x) {
        int cur = x;
        if (x < 0) {
            return false;
        }
        int res = 0;
        while (x != 0) {
            res = res * 10 + (x % 10);
            x /= 10;
        }
        return res == cur;
    }

    public static void main(String[] args) {
        System.out.println(isPalindrome(1321));
    }
}
